import 'package:flutter/material.dart';

class Register1 extends StatefulWidget {

  var arguments;

    Register1({Key? key,this.arguments='没有传递数据'}) : super(key: key);

  @override
  _Register1State createState() => _Register1State();
}

class _Register1State extends State<Register1> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('注册1页面'),),
      body: Column(
        children: [
          SizedBox(height: 300,),
          ElevatedButton(onPressed: (){

            Map  m =widget.arguments;
            m['name'] = 'name属性';
            Navigator.pushNamed(context, '/register2', arguments: m);

            // Navigator.pushReplacementNamed(context, '/register2');

          }, child: Text('注册1->注册2 数据=>${widget.arguments}')),
        ],
      ),
    );
  }
}
